<?php
namespace app\model;

use think\Model;
class Info extends Model{
    protected $pk='sid';

    protected static function onAfterRead($query){
        echo '查询方法被执行了....';
    }

    public function login(){
        return $this->hasOne(Login::class,'uid','sid');
    }

    public function grade(){
        return $this->hasMany(Grade::class,'uid','sid');
    }
}